package com.qingcloud.fexecutor.base.enums;

/**
 * 静态资源使用类型.
 *
 * @author wangjinnan
 */
public enum StaticUseTypeEnum {

    IMAGE(1, "图片"),
    BACKGROUND(2, "背景"),
    ICON(3, "ICO图标"),
    OTHER(4, "其他");


    /**
     * 类型编码
     */
    public final Integer code;

    public final String desc;

    StaticUseTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static StaticUseTypeEnum findByCode(Integer code) {
        for (StaticUseTypeEnum typeEnum : StaticUseTypeEnum.values()) {
            if (typeEnum.code.equals(code)) {
                return typeEnum;
            }
        }
        return OTHER;
    }

}
